package com.gaogao.java;

import java.util.Arrays;

public class BubbleTest {
    public static void main(String args[]){
        int[] a=new int[10];
        for (int i=0;i<a.length;i++){
            a[i]=(int)(100*Math.random()+1);
        }
        int temp=0;

        for (int i=0;i<a.length;i++){
            boolean b=true;
            for (int j=0;j<a.length-1-i;j++){
                if(a[j]>a[j+1]){
                    temp=a[j];
                    a[j]=a[j+1];
                    a[j+1]=temp;
                    b=false;

                }
                System.out.println(Arrays.toString(a));
            }
            System.out.println("=====================");
            if (b){
                break;
            }
        }
        System.out.println(Arrays.toString(a));
    }
}
